package day5;

public class Bus extends Vehicle{


    public Bus(String vehicleid, String brand, int rent, int seats, String state) {
        super(vehicleid, brand, rent, seats, state);

    }







    public void show() {
        System.out.println("客车"+"\t"+getBrand()+"\t"+"车牌号为"+getVehicleid()+"\t"+"座位数为"+getSeats()+"座"
                +"\t"+"日租金为"+getRent()+"元"+"\t"+super.getState());
    }
    public double calcRent(int days){
        double price=days*getRent();
        if (days>=3&&days<7){
            price*=0.9;
        }else if (days>=7&&days<30){
            price*=0.8;
        }else if (days>=30&&days<150){
            price*=0.7;
        }else if (days>=150){
            price*=0.6;
        }
        return price;
    }
}
